import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {//默认路由
      path: '/',
      redirect:"/login"
    },
    {//登录
      path: '/login',
      name: 'login',
      component: ()=>import("../views/login") //按需加载
    },
    {//主页
      path: '/index',
      name: 'index',
      component: ()=>import("../views/index"),
      children:[//子路由
        {//欢迎页
          path: 'welcome',
          name: 'welcome',
          component: ()=>import("../views/welcome") //按需加载
        },
        {//账户管理
          path: 'acc',
          name: 'acc',
          component: ()=>import("../views/account/index") //按需加载
        },
        {//类别管理
          path: 'cate',
          name: 'cate',
          component: ()=>import("../views/cate/index") //按需加载
        },
        {//部门管理
          path: 'dept',
          name: 'dept',
          component: ()=>import("../views/dept/index") //按需加载
        },
        {//学生管理
          path: 'stu',
          name: 'stu',
          component: ()=>import("../views/stu/index") //按需加载
        }
      ]
    }

  ]
})
